<?php
/**
 * Joomla! 1.5 component wbdatabase
 *
 * @version $Id: wbdatabase.php 2009-04-09 16:20:44 svn $
 * @author woomla
 * @package Joomla
 * @subpackage wbdatabase
 * @license GNU/GPL
 *
 * A personal database with some fields to remember logins and pin codes.
 *
 * This component file was created using the Joomla Component Creator by Not Web Design
 * http://www.notwebdesign.com/joomla_component_creator/
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.model');

/**
 * wbdatabase Component wbdatabase Model
 *
 * @author      notwebdesign
 * @package		Joomla
 * @subpackage	wbdatabase
 * @since 1.5
 */
class WbdatabaseModelWbdatabase extends JModel 
{
  var $_data;
  var $_description;
    /**
	 * Constructor
	 */
	function __construct() 
  {
		parent::__construct();
  }
  
  function _buildQuery()
  {
    $query = 'SELECT title FROM #__wbdatabase';
    return $query;
  }
  
  function getParameter()
  {
    $db =& JFactory::getDBO();
    
    $query = $this->_buildQuery();
    $db->setQuery($query);
    $result = $db->loadResult();     
    return $result;
  }
  
  function getData()
  {
    if (empty($this->data))
    {
      $query = $this->_buildQuery();
      $this->data = $this->_getList($query);
    }
    return $this->data;
  }
  
  function describeDatabase()
  {
    if (empty($this->description))
    {
      $query = "show columns from  jos_wbdatabase";
      $this->description = $this->_getList($query);
    }
    return $this->description;
  }
}
?>



